package com.shengdou.as.slopsapptest.utils;

import android.content.Context;

public class UiUtils {

	public static float dip2px(int dp, Context context) {
		// 屏幕密度
		float density = context.getResources().getDisplayMetrics().density;// 屏幕的密度
		return dp * density;

	}

	public static float px2dp(int px, Context context) {
		float density = context.getResources().getDisplayMetrics().density;// 屏幕的密度
		return px / density;
	}

}
